/*
	Name: 传染病控制
	Author: There,hello
	Date: 26-10-19 18:05
	Description: Luogu P1014
	Algorithm: 爆搜
*/
#include<bits/stdc++.h>
using namespace std;
int n,m,head[305],tail,size[305],fa[305];
bool pd[305];
#define add(x,y) edge[++tail]=(dd){head[x],y};head[x]=tail;
struct dd{
	int ne,to;
}edge[1000];
int ans=0x7fffffff;
int deep[305][305];
void dfs(int t,int faa,int depth){
	fa[t]=faa;
	deep[depth][++deep[depth][0]]=t;
	size[t]=1;
	for(int i=head[t];i;i=edge[i].ne){
		if(edge[i].to==faa)continue;
		dfs(edge[i].to,t,depth+1);
		size[t]+=size[edge[i].to];
	}
}
void tag(int t,int faa){
	pd[t]=1;
	for(int i=head[t];i;i=edge[i].ne){
		if(edge[i].to==faa)continue;
		tag(edge[i].to,t);
	}
}
void clean_(int t,int faa){
	pd[t]=0;
	for(int i=head[t];i;i=edge[i].ne){
		if(edge[i].to==faa)continue;
		clean_(edge[i].to,t);
	}
}
void dfs2(int depth,int sum){
	ans=min(ans,sum);
	for(int i=1;i<=deep[depth][0];++i){
		if(pd[deep[depth][i]])continue;
		tag(deep[depth][i],fa[deep[depth][i]]);
		dfs2(depth+1,sum-size[deep[depth][i]]);
		clean_(deep[depth][i],fa[deep[depth][i]]);
	}
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1,x,y;i<=m;++i){
		scanf("%d%d",&x,&y);
		add(x,y);add(y,x);
	}
	dfs(1,1,1);
	dfs2(2,size[1]);
	printf("%d",ans);
	return 0;
}